﻿<%@page import="com.cchr.acms.model.Action"%>
<%@page import="com.cchr.acms.model.AbuseType"%>
<%@page import="com.cchr.acms.util.HtmlComponentUtil.SelectOption"%>
<%@page import="java.util.List"%>
<%@page import="com.cchr.acms.util.HtmlComponentUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%
	String contextPath = request.getContextPath();
%>

	<form class="panel form-horizontal" id="jq-validation-form" method="POST" style="width:1000px; color:black;">
		<div class="row">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr" style="text-align:center; margin-top:-25px">
					<label class="control-label"><h2>Case No:${caseInfo.caseNo}</h2></label>
				</div>
			</div>
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
				<a id="editBtn" class="btn btn-primary" style="border-radius:0px;width:110px;" target="_blank" href="<%=contextPath%>/rpt/followUp/${caseInfo.id}">Export PDF</a>
				<br>
				<br>
			<c:choose>
			<c:when test="${caseInfo.userId == null}">
					<c:if test="${caseInfo.status != '5' and caseInfo.status != '6' }">					
						<a id="editBtn" class="btn btn-primary" style="border-radius:0px;width:110px" href="<%=contextPath%>/case/detail/${caseInfo.id}?edit=true">EDIT</a>
					</c:if>	
			</c:when>
				<c:when test="${caseInfo.userId != null}">
					<c:if test="${caseInfo.status != '5' and caseInfo.status != '6' and caseInfo.userId == user.id}">					
						<a id="editBtn" class="btn btn-primary" style="border-radius:0px;width:110px;" href="<%=contextPath%>/case/detail/${caseInfo.id}?edit=true">EDIT</a>
				</c:if>	
			</c:when>
		  </c:choose>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr" style="text-align:center; margin-top:-25px">
					<label class="control-label"><h2>${caseInfo.abusedPerson.firstName.concat(' ')}${caseInfo.abusedPerson.middleName.concat(' ')}${caseInfo.abusedPerson.lastName}</h2></label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-2">
				<div class="form-group no-margin-hr">
				</div>
			</div>
			<div class="col-sm-8">
				<div class="form-group no-margin-hr" style="text-align:center; margin-top:-25px">
					<label class="control-label"><h2>Initial Contact:<fmt:formatDate value="${caseInfo.createDate}" pattern="MM/dd/yyyy"/></h2></label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Has the Abuse Case Been Contacted?
								<c:choose>
									<c:when test="${followup.beenContacted == '1' }">
										Yes
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${followup.beenContacted == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Date Contacted: <fmt:formatDate value="${followup.contactedDate}" pattern="MM/dd/yyyy"/></label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>By Who? 
							<c:if test="${not empty followup.followedType}">
								<c:if test="${followup.followedType == '0'}">CCHR International, ${followup.staffMemeberFirstName1 } ${followup.staffMemeberLastName1 }</c:if>
								<c:if test="${followup.followedType == '1'}">CCHR Chapter, ${followup.staffMemeberFirstName2 } ${followup.staffMemeberLastName2 }</c:if>
							</c:if>
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>
							Contacted by:
							<c:set var="loop" value="0"/>
							<c:forEach var="contact" items="${contactWays }" varStatus="status">  
					     		<c:choose>
									<c:when test="${fn:contains(followup.contactedBy, contact)}">
										<c:set var="loop" value="${loop + 1 }"/>
										<c:if test="${loop != 1 }">, </c:if>${contact }
									</c:when>
								</c:choose>
				   			</c:forEach> 
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>
							Notes:
						</label>
						<br>
						<label style="word-break:break-all;"> ${followup.contactedNotes }</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Did the Abused Person Use Insurance? 
								<c:choose>
									<c:when test="${followup.userInsurance == '1' }">
										Yes
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${followup.userInsurance == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>
							What Type Was Used?
							<c:set var="loop" value="0"/>
							<c:forEach var="type" items="${insuranceType }" varStatus="status">  
					     		<c:choose>
									<c:when test="${fn:contains(followup.insuranceType, type)}">
										<c:set var="loop" value="${loop + 1 }"/>
										<c:if test="${loop != 1 }">, </c:if>${type }
									</c:when>
								</c:choose>
				   			</c:forEach> 
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Insurance Company Name: ${followup.insurance1CompanyName }
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>
							Notes on Insurance Details:
						</label>
						<label style="word-break:break-all;"> ${followup.notesOnInsuranceDetail }</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Attorney Status:  
							<c:set var="loop" value="0"/>
							<c:forEach var="type" items="${attorneyStatus }" varStatus="status">  
				     			<c:choose>
									<c:when test="${fn:contains(followup.attorneyStatus, type)}">
										<c:set var="loop" value="${loop + 1 }"/>
										<c:if test="${loop != 1 }">, </c:if>${type } 
									</c:when>
								</c:choose>
   							</c:forEach>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					<label>
						Notes on Attorney status:
					</label>
					<label style="word-break:break-all;"> ${followup.notesOnAttorneyStatus }</label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Abuse Case Referred to Attorney? 
								<c:choose>
									<c:when test="${followup.referAttorneyStatus == '1' }">
										${followup.referAttorneyFirstName } ${followup.referAttorneyLastName }
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${followup.referAttorneyStatus == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Date Referred: <fmt:formatDate value="${followup.referAttorneyDate}" pattern="MM/dd/yyyy"/>
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Accepted by attorney: 
							<c:choose>
								<c:when test="${followup.referAttorneyAccteptFlag == '1' }">
									Yes
								</c:when>
								<c:otherwise>
									No
								</c:otherwise>
							</c:choose>
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Date Accepted:
							<c:choose>
								<c:when test="${followup.referAttorneyAccteptFlag == '1' }">
									<fmt:formatDate value="${followup.referAttorneyAccteptDate}" pattern="MM/dd/yyyy"/>
								</c:when>
							</c:choose>
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Reason, if given: 
						</label>
						<c:choose>
							<c:when test="${followup.referAttorneyAccteptFlag != '1' }">
								<label style="word-break:break-all;"> ${followup.referAttorneyDeclinedReason }</label>
							</c:when>
						</c:choose>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Notes on Attorney Referral:
						</label>
						<label style="word-break:break-all;"> ${followup.notesOnReferal }</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Has a Complaint Been Filed on This Abuse? 
								<c:choose>
									<c:when test="${followup.filledWithAgency == '1' }">
										Yes
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${followup.filledWithAgency == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Date Field: <fmt:formatDate value="${followup.filleWithAgencyDate}" pattern="MM/dd/yyyy"/>
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Agency the Complaint Was Filed With: ${followup.filledAgencyName}
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Contact Name: ${followup.filledAgencyContactName}
						</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Address: ${followup.filledAgencyAddress.concat(', ')}${followup.filledAgencyCity.concat(', ')}${followup.filledAgencyState.concat(' ')}${followup.filledAgencyZip.concat(', ')}${followup.filledAgencyCountry}
						</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Was a Response Received on the Complaint? 
								<c:choose>
									<c:when test="${followup.compliantResponseReceived == '1' }">
										Yes
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${followup.compliantResponseReceived == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>What Was the Response?
						</label>
						<label style="word-break:break-all;"> ${followup.compliantResponseContent }</label>
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Notes on Complaint Filed?
						</label>
						<label style="word-break:break-all;"> ${followup.noteOnCompliant }</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Has the Abused Person Signed a General Waiver? 
								<c:choose>
									<c:when test="${followup.abusedPersonSigneWaiver == '1' }">
										Yes
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${followup.abusedPersonSigneWaiver == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Date Signed: <fmt:formatDate value="${followup.abusedPersonSigneDate}" pattern="MM/dd/yyyy"/>
						</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Has CCHR Received Documents From the Abused? 
								<c:choose>
									<c:when test="${followup.cchrReceivedAbusedDoc == '1' }">
										Yes
									</c:when>
									<c:otherwise>
										No
									</c:otherwise>
								</c:choose>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<c:if test="${followup.cchrReceivedAbusedDoc == '1'}">
			<div class="row">
				<div class="col-sm-offset-1 col-sm-11">
					<div class="detail-info">
						<label>Date Received: <fmt:formatDate value="${followup.cchrReceivedAbusedDocDate}" pattern="MM/dd/yyyy"/>
						</label>
					</div>
				</div>
			</div>
		</c:if>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Other Actions Taken on the Case:
						</h3>
					</label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					</label>
					<label style="word-break:break-all;"> ${followup.otherActionsTaken }</label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Current Status of the Case: 
						</h3>
					</label>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-sm-offset-1 col-sm-11">
				<div class="detail-info">
					</label>
					<label style="word-break:break-all;"> ${followup.currentStatusOnCase }</label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Date Case Was Last Updated: <fmt:formatDate value="${followup.caseLastUpdatedDate}" pattern="MM/dd/yyyy"/>
						</h3>
					</label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Case Category: ${followup.caseCategory}
						</h3>
					</label>
				</div>
			</div>
		</div>
		<hr>
		<div class="row">
			<div class="col-sm-12">
				<div class="form-group no-margin-hr">
					<label class="control-label">
						<h3 style="margin-bottom:10px; margin-top:10px" class="form-header">
							Case Status:
							<c:forEach var="status" items="${caseStatus }">  
								<c:choose>
									<c:when test="${caseInfo.status == status.value}">
										${status.key }
									</c:when>
								</c:choose>
			   				</c:forEach>	
						</h3>
					</label>
				</div>
			</div>
		</div>
	</form>
<!-- Get jQuery from Google CDN -->
<!--[if !IE]> -->
	<script type="text/javascript"> window.jQuery || document.write('<script src="<%=contextPath%>/assets/javascripts/jquery-2.0.3.min.js">'+"<"+"/script>"); </script>
<!-- <![endif]-->
<!--[if lte IE 9]>
	<script type="text/javascript"> window.jQuery || document.write('<script src="<%=contextPath%>/assets/javascripts/jquery-1.8.3.min.js">'+"<"+"/script>"); </script>
<![endif]-->